<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\SysAdminUser */
/* @var $form yii\widgets\ActiveForm */
?>
<style>
.form-group{width:200px;}
.field-sysadminuser-last_login_time{display:none;}
.field-sysadminuser-last_ip{display:none;}
.field-sysadminuser-reg_time{display:none;}
</style>
<div>
<?php 
	if($message == '修改成功'){
		echo "
<script>
            alert('密码修改成功，请重新登录');
            location.href='/site/logout';
</script>
		";
	}


?>
</div>

<form action='' method='POST' onsubmit='return check()'>

<div class="form-group ">
	<label class="control-label">原密码</label>
	<input type="password" class='form-control' name='old_pwd'>
</div>

<div class="form-group ">
	<label class="control-label">新密码</label>
	<input type='password' class='form-control old'>
</div>

<div class="form-group ">
	<label class="control-label">确认新密码</label>
	<input type='password' class='form-control new' name='new_pwd'>
</div>

    <div class="form-group">
        <input type='submit' class='btn btn-success' name='sub' />
    </div>

    </form>
</div>
<script type="text/javascript" src='/js/jquery.js'></script>
<script>
function check(){
	var pwd1 = $('.old').val();
	var pwd2 = $('.new').val();
	if(pwd1 != pwd2){
		alert('两次输入的密码不一致');
		return false;
	}else if(pwd2.length <= 5){
		alert('密码强度不够');
		return false;
	}else{
		return true;
	}
}
</script>